StoreFile
by Takis Merkouris, NeXT Systems Engineer

Overview

This example demonstrates the IXStoreFile class of the Indexing Kit.  It allows you to create IXStoreFiles for storing data bearing objects.  Objects may be added to the store, replaced and removed.  Please use the ".store" filename extension for the IXStoreFiles you create, because this is the extension recognized by the OpenPanel. You will not be able to open the IXStoreFiles you have created unless they have this extension.

Classes defined in StoreFile

The DataWrapper class  is a simple class with two attributes: key (char *), and value (int). No semantics are attached to the key other than associating a name with an instance. Names do not have to be unique in this application.

The data wrappers that hold user data are stored by archiving into store blocks, and the block numbers allocated for them are stored in a list of auxilliary data wrappers. Each auxilliary wrapper contains the key and the block number of its principal. The list of auxilliaries is stored in the boot block of the IXStoreFile (this is the first block allocated after you create an IXStore or IXStoreFile - guaranteed to have the value 1); the in- memory list and the one stored in the IXStoreFile are kept synchronized at all times.

The code that implements the DataWrapper lives in DataWrapper.[hm]; the code that implements the access to the IXStoreFile lives in StoreManager.[hm] and is implemented by the StoreManager class, also the window's delegate. The Controller class is the distribution class which creates StoreManager objects.

Change History

Updated for 3.0 Release	Mai Nguyen
Revised July 19, 1992	Jack Greenfield